package a.f.d;

import a.a.jb;
import a.a.kb;
import a.c.ab;
import a.c.bb;
import a.c.d;
import a.c.e;
import a.c.i;
import a.c.k;
import a.c.q;
import a.c.v;
import a.c.w;
import a.f.d.a.ac;
import a.f.d.a.bc;
import a.f.d.a.hc;
import a.f.d.a.zb;
import a.f.ed;
import a.f.o;
import a.i.db;
import a.i.l;

import java.util.*;

public class hb
  implements fb, zb
{
  private boolean a = true;
  int b = 5;
  boolean c = false;
  public static boolean d;
  
  public boolean a()
  {
    return this.a;
  }
  
  public void a(boolean paramBoolean)
  {
    this.a = paramBoolean;
  }
  
  public int b()
  {
    return this.b;
  }
  
  public void a(int paramInt)
  {
    this.b = paramInt;
  }
  
  private int b(o paramo, a.c.x paramx, ab paramab)
  {
    int i8 = f.o;
    int i7 = f.n;
    int i = 0;
    a.i.y localy = new a.i.y(paramo);
    a.f.d.a.hb localhb = (a.f.d.a.hb)paramo.c("groupingSupport").get(paramo);
    Object localObject1 = paramo.v();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      localObject2 = ((w)localObject1).d();
      if (i8 == 0)
      {
        if (localhb.g((e)localObject2)) {
          localy.a((e)localObject2);
        }
        ((w)localObject1).f();
      }
    } while (i7 == 0);
    localObject1 = null;
    localObject1 = paramo.i();
    Object localObject2 = paramo.v();
    do
    {
      do
      {
        if (!((w)localObject2).e()) {
          break;
        }
        localObject3 = ((w)localObject2).d();
        if (i8 != 0) {
          break label242;
        }
        if (i7 != 0) {
          break label233;
        }
        if (localObject3 != localObject1)
        {
          if (i8 != 0) {
            continue;
          }
          if (((e)localObject3).d() == 0) {
            localObject4 = paramo.a((e)localObject1, (e)localObject3);
          }
        }
        ((w)localObject2).f();
      } while (i7 == 0);
      if (i8 != 0) {
        break;
      }
    } while (i8 != 0);
    if (!this.c)
    {
      a(paramo, paramx, (e)localObject1);
      localObject2 = paramo.v();
      label233:
      label242:
      do
      {
        do
        {
          if (!((w)localObject2).e()) {
            break;
          }
          localObject3 = ((w)localObject2).d();
          ((w)localObject2).f();
          if (i8 != 0) {
            break label272;
          }
          if (i7 != 0) {
            break label270;
          }
        } while (i7 == 0);
      } while (i8 != 0);
      i = paramo.j() + 1;
      label270:
      label272:
      if (i8 != 0) {
        break label313;
      }
      if (i7 == 0) {}
    }
    else
    {
      localObject2 = new n();
      paramo.c((e)localObject1, 0.0D, -1.797693134862316E+308D);
      i = ((n)localObject2).a(paramo, paramx, paramab);
    }
    label313:
    localObject2 = db.a(new int[paramo.j()]);
    Object localObject3 = paramo.v();
    do
    {
      do
      {
        if (!((w)localObject3).e()) {
          break;
        }
        localObject4 = ((w)localObject3).d();
        a((a.c.x)localObject2, (e)localObject4, paramx);
        ((w)localObject3).f();
      } while (i7 == 0);
    } while (i8 != 0);
    localObject3 = db.a(new int[paramo.j()]);
    Object localObject4 = paramo.v();
    do
    {
      if (!((w)localObject4).e()) {
        break;
      }
      localObject5 = ((w)localObject4).d();
      ((a.c.x)localObject3).a(localObject5, a.a.m.a(paramo, new bb((e)localObject5), 2147483647).size());
      ((w)localObject4).f();
    } while (i7 == 0);
    localObject4 = new Comparator()
    {
      private final a.c.x val$layerMap;
      private final a.c.x val$successSizeMap;
      
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        int i = l.a(this.val$layerMap.getInt(paramAnonymousObject1), this.val$layerMap.getInt(paramAnonymousObject2));
        if (f.o == 0) {
          if (i == 0) {
            i = l.a(this.val$successSizeMap.getInt(paramAnonymousObject1), this.val$successSizeMap.getInt(paramAnonymousObject2));
          }
        }
        return i;
      }
    };
    Object localObject5 = new bb(paramo.t());
    ((bb)localObject5).a((Comparator)localObject4);
    k localk1 = paramo.c(ed.c);
    k localk2 = paramo.c(ed.d);
    label590:
    label975:
    label979:
    do
    {
      for (;;)
      {
        if (!((bb)localObject5).isEmpty())
        {
          localObject6 = ((bb)localObject5).o();
          int j = paramx.getInt(localObject6);
          int[] arrayOfInt = new int[i];
          Object localObject7 = paramo.v();
          do
          {
            if (!((w)localObject7).e()) {
              break label590;
            }
            localObject8 = ((w)localObject7).d();
            arrayOfInt[paramx.getInt(localObject8)] += 1;
            ((w)localObject7).f();
            if ((i8 == 0) && (i7 != 0)) {
              break;
            }
          } while (i7 == 0);
          if (i8 != 0) {
            break label1239;
          }
          localObject7 = paramo.w();
          int i3;
          do
          {
            do
            {
              if (!((a.c.m)localObject7).e()) {
                break label840;
              }
              localObject8 = ((a.c.m)localObject7).a();
              if (i7 != 0) {
                break label1164;
              }
              if ((((d)localObject8).e() != localObject1) && (((i8 == 0) && (localk1 == null)) || ((i8 == 0) && (localk2 == null)) || (((i8 != 0) || (localk1.get(localObject8) != localk2.get(localObject8))) && (((i8 == 0) && (localk1.get(localObject8) == null)) || ((i8 != 0) || (!localk1.get(localObject8).equals(localk2.get(localObject8))))))))
              {
                int m = Math.min(paramx.getInt(((d)localObject8).e()), paramx.getInt(((d)localObject8).f())) + 1;
                int i1 = Math.max(paramx.getInt(((d)localObject8).e()), paramx.getInt(((d)localObject8).f())) - 1;
                i3 = m;
                do
                {
                  if (i3 > i1) {
                    break;
                  }
                  arrayOfInt[i3] += 1;
                  i3++;
                  if (i8 != 0) {
                    break label837;
                  }
                  if (i7 != 0) {
                    break label835;
                  }
                } while (i7 == 0);
              }
            } while (i8 != 0);
            ((a.c.m)localObject7).f();
          } while (i7 == 0);
          localObject7 = new HashMap();
          a(paramo, paramx, (Map)localObject7);
          if (i8 != 0) {
            break label1238;
          }
          Object localObject8 = ((Map)localObject7).entrySet().iterator();
          do
          {
            int i5;
            int i6;
            while (i6 > i5)
            {
              if (!((Iterator)localObject8).hasNext()) {
                break;
              }
              Map.Entry localEntry = (Map.Entry)((Iterator)localObject8).next();
              localObject9 = (int[])localEntry.getValue();
              i3 = localObject9[0];
              i5 = localObject9[1];
              i6 = i3;
            }
            arrayOfInt[i6] += 1;
            i6++;
            if ((i8 != 0) || (i8 != 0)) {
              break label979;
            }
            if (i7 != 0) {
              break label975;
            }
            if ((i8 == 0) && (i7 != 0)) {
              break;
            }
          } while (i7 == 0);
          int k = b();
          int n = -1;
          if (i8 != 0) {
            break label1164;
          }
          Object localObject9 = ((e)localObject6).i();
          do
          {
            if (localObject9 == null) {
              break label1045;
            }
            e locale2 = ((d)localObject9).e();
            n = Math.max(paramx.getInt(locale2), n);
            localObject9 = ((d)localObject9).j();
            if ((i8 == 0) && (i7 != 0)) {
              break;
            }
          } while (i7 == 0);
          if (i8 == 0)
          {
            int i2 = j - 1;
            int i4;
            do
            {
              if (i2 <= n) {
                break;
              }
              i4 = arrayOfInt[i2];
              if (i8 != 0) {
                break label1162;
              }
              if ((i8 != 0) || (i7 != 0)) {
                break label1160;
              }
            } while (i7 != 0);
            if (i4 >= k)
            {
              if ((i8 == 0) && (i4 < k)) {
                continue;
              }
              if (i8 == 0) {
                if (a((e)localObject6, paramx, (e)localObject1)) {
                  continue;
                }
              }
            }
            else
            {
              paramx.a(localObject6, i2);
              i2--;
            }
            if (i7 == 0) {
              break;
            }
          }
        }
      }
      a(paramo, paramx, i, (e)localObject1);
    } while (i8 != 0);
    label835:
    label837:
    label840:
    i = 0;
    label1045:
    e locale1;
    label1160:
    label1162:
    if (localObject1 != null)
    {
      label1164:
      paramo.a((e)localObject1);
      localObject6 = paramo.v();
      do
      {
        if (!((w)localObject6).e()) {
          break;
        }
        locale1 = ((w)localObject6).d();
        paramx.a(locale1, paramx.getInt(locale1) - 1);
        ((w)localObject6).f();
        if (i8 != 0) {
          break label1251;
        }
        if (i7 != 0) {
          break label1244;
        }
      } while (i7 == 0);
    }
    label1238:
    label1239:
    Object localObject6 = paramo.v();
    label1244:
    label1251:
    do
    {
      if (!((w)localObject6).e()) {
        break;
      }
      locale1 = ((w)localObject6).d();
      i = Math.max(i, paramx.getInt(locale1));
      ((w)localObject6).f();
      if (i8 != 0) {
        break label1323;
      }
      if (i7 != 0) {
        break label1319;
      }
    } while (i7 == 0);
    i = a(paramo, paramx, paramx);
    if (i8 == 0) {
      localy.g();
    }
    label1319:
    label1323:
    return i + 1;
  }
  
  private void a(a.c.x paramx, e parame, k paramk)
  {
    int k = f.o;
    int j = f.n;
    int i = paramk.getInt(parame);
    d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.f();
      i = Math.max(i, paramk.getInt(locale));
      locald = locald.i();
      if ((k == 0) && (j != 0)) {
        return;
      }
    } while (j == 0);
    if (k == 0) {
      paramx.a(parame, i);
    }
  }
  
  private boolean a(e parame1, a.c.x paramx, e parame2)
  {
    int m = f.o;
    int k = f.n;
    if (m == 0) {
      if (parame1.d() != 1) {
        return false;
      }
    }
    e locale = parame1.i().e();
    if (locale == parame2) {
      return true;
    }
    int i = paramx.getInt(parame1);
    int j = 0;
    d locald = locale.h();
    if (locald != null) {}
    while (m != 0)
    {
      if (k != 0) {
        break label110;
      }
      if (paramx.getInt(locald.f()) >= i) {
        j++;
      }
      locald = locald.i();
      if (k == 0) {
        break;
      }
    }
    label110:
    return j > 1;
  }
  
  private boolean b(e parame1, a.c.x paramx, e parame2)
  {
    int m = f.o;
    int k = f.n;
    if (m == 0) {
      if (parame1.e() != 1) {
        return false;
      }
    }
    e locale = parame1.h().f();
    if (locale == parame2) {
      return true;
    }
    int i = paramx.getInt(parame1);
    int j = 0;
    d locald = locale.i();
    if (locald != null) {}
    while (m != 0)
    {
      if (k != 0) {
        break label110;
      }
      if (paramx.getInt(locald.e()) <= i) {
        j++;
      }
      locald = locald.j();
      if (k == 0) {
        break;
      }
    }
    label110:
    return j > 1;
  }
  
  public void b(boolean paramBoolean)
  {
    this.c = paramBoolean;
  }
  
  private void a(o paramo, a.i.y paramy)
  {
    int j = f.o;
    int i = f.n;
    k localk = paramo.c(ed.c);
    ab localab = a.a.m.b(paramo);
    HashMap localHashMap = new HashMap();
    Object localObject1 = paramo.v();
    Object localObject4;
    label163:
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      localObject2 = ((w)localObject1).d();
      if (j == 0)
      {
        if (localk != null)
        {
          localObject3 = localk.get(localObject2);
          if (j != 0) {
            continue;
          }
          if (localObject3 != null)
          {
            localObject4 = (Integer)localHashMap.get(localObject3);
            if (j == 0) {
              if (localObject4 != null)
              {
                localHashMap.put(localObject3, new Integer(((Integer)localObject4).intValue() + 1));
                if (j != 0) {
                  continue;
                }
                if (i == 0) {
                  break label163;
                }
              }
            }
            localHashMap.put(localObject3, new Integer(1));
          }
        }
        ((w)localObject1).f();
      }
    } while (i == 0);
    localObject1 = db.b();
    Object localObject2 = paramo.v();
    label327:
    do
    {
      if (!((w)localObject2).e()) {
        break;
      }
      localObject3 = ((w)localObject2).d();
      if (j == 0)
      {
        if (localk != null)
        {
          localObject4 = localk.get(localObject3);
          if (localObject4 != null)
          {
            Integer localInteger = (Integer)localHashMap.get(localObject4);
            a.c.m localm = ((e)localObject3).n();
            do
            {
              if (!localm.e()) {
                break label327;
              }
              d locald = localm.a();
              if (i != 0) {
                break;
              }
              if (localInteger != null)
              {
                ((a.c.n)localObject1).a(locald, 1.0D / localInteger.doubleValue());
                if (j != 0) {
                  continue;
                }
                if (i == 0) {}
              }
              else
              {
                ((a.c.n)localObject1).a(locald, 1.0D);
              }
              localm.f();
            } while (i == 0);
          }
        }
        ((w)localObject2).f();
      }
    } while (i == 0);
    localObject2 = a.a.hb.a(paramo, (k)localObject1);
    do
    {
      do
      {
        if (localab.isEmpty()) {
          break;
        }
        paramo.a(localab.o());
      } while (i == 0);
    } while (j != 0);
    Object localObject3 = ((ab)localObject2).l();
    do
    {
      if (!((a.c.m)localObject3).e()) {
        break;
      }
      localObject4 = ((a.c.m)localObject3).a();
      if (j == 0)
      {
        if (((d)localObject4).c() == null) {
          ((ab)localObject2).b((a.c.y)localObject3);
        }
        ((a.c.m)localObject3).f();
      }
    } while (i == 0);
    localObject3 = new ab(paramo.w());
    ((ab)localObject3).removeAll((Collection)localObject2);
    paramy.a((ab)localObject3);
  }
  
  private void a(q paramq, k paramk, Map paramMap)
  {
    int j = f.o;
    int i = f.n;
    k localk1 = paramq.c(ed.c);
    k localk2 = paramq.c(ed.d);
    a.c.m localm = paramq.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      if (j == 0)
      {
        if ((localk1 != null) && ((j != 0) || (localk2 != null)) && ((j != 0) || (localk2.get(locald) != null)))
        {
          if (j != 0) {
            continue;
          }
          if (localk2.get(locald).equals(localk1.get(locald)))
          {
            Object localObject = localk2.get(locald);
            int[] arrayOfInt = (int[])paramMap.get(localObject);
            if (j == 0)
            {
              if (arrayOfInt == null)
              {
                arrayOfInt = new int[] { 2147483647, -2147483648 };
                paramMap.put(localObject, arrayOfInt);
              }
              arrayOfInt[0] = Math.min(arrayOfInt[0], paramk.getInt(locald.e()) + 1);
              arrayOfInt[0] = Math.min(arrayOfInt[0], paramk.getInt(locald.f()) + 1);
              arrayOfInt[1] = Math.max(arrayOfInt[1], paramk.getInt(locald.e()) - 1);
            }
            arrayOfInt[1] = Math.max(arrayOfInt[1], paramk.getInt(locald.f()) - 1);
          }
        }
        localm.f();
      }
    } while (i == 0);
  }
  
  private static void a(q paramq, a.c.x paramx)
  {
    e locale = kb.h(paramq);
    a(locale, paramx);
  }
  
  private static int a(e parame, a.c.x paramx)
  {
    int k = f.o;
    int j = f.n;
    int i = 1;
    d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.f();
      i += a(locale, paramx);
      locald = locald.i();
      if (k != 0) {
        break label70;
      }
      if (j != 0) {
        return i;
      }
    } while (j == 0);
    if (k == 0) {
      paramx.a(parame, i);
    }
    label70:
    return i;
  }
  
  private static void b(q paramq, a.c.x paramx)
  {
    int m = f.o;
    int k = f.n;
    q localq = new q();
    a.c.x localx1 = paramq.B();
    a.c.x localx2 = localq.B();
    Object localObject1 = paramq.v();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      localObject2 = ((w)localObject1).d();
      if (k != 0) {
        break label99;
      }
      localObject3 = localq.i();
      localx1.a(localObject2, localObject3);
      localx2.a(localObject2, localObject3);
      ((w)localObject1).f();
    } while (k == 0);
    label99:
    localObject1 = paramq.w();
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      localq.a((e)localx1.get(((d)localObject2).e()), (e)localx1.get(((d)localObject2).f()));
      ((a.c.m)localObject1).f();
      if (m != 0) {
        break label188;
      }
      if (k != 0) {
        break label187;
      }
    } while (k == 0);
    if (m == 0) {
      jb.b(localq);
    }
    label187:
    label188:
    int i = 0;
    Object localObject2 = localq.B();
    Object localObject3 = localq.v();
    e locale1;
    do
    {
      do
      {
        if (!((w)localObject3).e()) {
          break;
        }
        locale1 = ((w)localObject3).d();
        ((a.c.x)localObject2).a(locale1, -1);
        if (m != 0) {
          break label266;
        }
        ((w)localObject3).f();
        if (k != 0) {
          break label264;
        }
      } while (k == 0);
    } while (m != 0);
    localObject3 = localq.v();
    label264:
    label266:
    label302:
    label364:
    label366:
    do
    {
      do
      {
        if (!((w)localObject3).e()) {
          break;
        }
        locale1 = ((w)localObject3).d();
        int j = locale1.f();
        i = locale1.e();
        d locald1 = locale1.h();
        e locale2;
        do
        {
          do
          {
            if (locald1 == null) {
              break;
            }
            locale2 = locald1.f();
            ((a.c.x)localObject2).a(locale2, locale1.f());
            if (m != 0) {
              break label366;
            }
            locald1 = locald1.i();
            if (k != 0) {
              break label364;
            }
          } while (k == 0);
        } while (m != 0);
        locald1 = locale1.h();
        do
        {
          if (locald1 == null) {
            break label462;
          }
          locale2 = locald1.f();
          if (k != 0) {
            break label302;
          }
          d locald2 = locale1.i();
          do
          {
            if (locald2 == null) {
              break label445;
            }
            e locale3 = locald2.e();
            if (k != 0) {
              break;
            }
            if (((a.c.x)localObject2).getInt(locale3) != j)
            {
              ((a.c.x)localObject2).a(locale3, j);
              i++;
            }
            locald2 = locald1.j();
          } while (k == 0);
          locald1 = locald1.i();
          if (m != 0) {
            break;
          }
        } while (k == 0);
        paramx.a(localx2.get(locale1), i);
        ((w)localObject3).f();
      } while (m != 0);
    } while (k == 0);
    label445:
    label462:
    return;
  }
  
  int a(q paramq, e parame, boolean[] paramArrayOfBoolean)
  {
    int n = f.o;
    int m = f.n;
    int i = 0;
    boolean[] arrayOfBoolean1 = new boolean[paramq.j()];
    bb localbb = b(paramq, parame, paramArrayOfBoolean);
    Object localObject = localbb.l();
    e locale1;
    do
    {
      do
      {
        if (!((w)localObject).e()) {
          break;
        }
        locale1 = ((w)localObject).d();
        i += a(locale1, arrayOfBoolean1);
        ((w)localObject).f();
        if (n != 0) {
          break label109;
        }
        if (m != 0) {
          break label102;
        }
      } while (m == 0);
    } while (n != 0);
    localObject = paramq.v();
    label102:
    label109:
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      locale1 = ((w)localObject).d();
      if (n != 0) {
        break label168;
      }
      if (m != 0) {
        break label166;
      }
      if (paramArrayOfBoolean[locale1.f()] != 0) {
        arrayOfBoolean1[locale1.f()] = true;
      }
      ((w)localObject).f();
    } while (m == 0);
    label166:
    label168:
    localObject = new boolean[paramq.j()];
    int j = 0;
    label221:
    do
    {
      do
      {
        if (j >= arrayOfBoolean1.length) {
          break;
        }
        if ((n == 0) && (m != 0)) {
          break label245;
        }
        if (n == 0) {
          if (paramArrayOfBoolean[j] == 0) {
            if (n != 0) {
              break label221;
            }
          }
        }
        localObject[j] = (arrayOfBoolean1[j] != 0 ? 1 : 0);
        j++;
      } while (m == 0);
    } while (n != 0);
    label245:
    boolean[] arrayOfBoolean2 = new boolean[paramq.j()];
    w localw = paramq.v();
    label350:
    label363:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale2 = localw.d();
      do
      {
        if (m != 0) {
          break;
        }
        if (arrayOfBoolean1[locale2.f()] != 0)
        {
          i += a(locale2, (boolean[])localObject, arrayOfBoolean2);
          int k = 0;
          do
          {
            if (k >= arrayOfBoolean2.length) {
              break label363;
            }
            if (m != 0) {
              break;
            }
            if (n == 0) {
              if (localObject[k] == 0) {
                if (n != 0) {
                  break label350;
                }
              }
            }
            localObject[k] = (arrayOfBoolean2[k] != 0 ? 1 : 0);
            k++;
          } while (m == 0);
        }
        localw.f();
      } while (n != 0);
    } while (m == 0);
    return i;
  }
  
  private bb b(q paramq, e parame, boolean[] paramArrayOfBoolean)
  {
    int j = f.o;
    int i = f.n;
    bb localbb = new bb(parame);
    k localk = paramq.c(ed.c);
    if ((localk != null) && ((j != 0) || (parame.d() == 1)))
    {
      d locald1 = parame.i();
      Object localObject = localk.get(locald1);
      e locale = locald1.e();
      d locald2 = locale.h();
      do
      {
        if (locald2 == null) {
          break;
        }
        if (j == 0) {
          if ((locald2 != locald1) && (localk.get(locald2) == localObject))
          {
            if (j != 0) {
              continue;
            }
            if (paramArrayOfBoolean[locald2.f().f()] == 0) {
              localbb.add(locald2.f());
            }
          }
        }
        locald2 = locald2.i();
      } while (i == 0);
    }
    return localbb;
  }
  
  private int a(e parame, boolean[] paramArrayOfBoolean)
  {
    int m = f.o;
    int k = f.n;
    int i = 0;
    if (m == 0)
    {
      if (paramArrayOfBoolean[parame.f()] == 0) {
        i++;
      }
    }
    else {
      paramArrayOfBoolean[parame.f()] = true;
    }
    d locald = parame.h();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.f();
      int j = locale.f();
      if (k != 0) {
        break label96;
      }
      if (paramArrayOfBoolean[j] == 0) {
        i += a(locale, paramArrayOfBoolean);
      }
      locald = locald.i();
    } while (k == 0);
    label96:
    return i;
  }
  
  private int a(e parame, boolean[] paramArrayOfBoolean1, boolean[] paramArrayOfBoolean2)
  {
    int m = f.o;
    int k = f.n;
    int i = 0;
    if (m == 0)
    {
      if (paramArrayOfBoolean2[parame.f()] == 0) {
        i++;
      }
    }
    else {
      paramArrayOfBoolean2[parame.f()] = true;
    }
    d locald = parame.i();
    do
    {
      if (locald == null) {
        break;
      }
      e locale = locald.e();
      if (k != 0) {
        break label116;
      }
      if (paramArrayOfBoolean1[locale.f()] == 0)
      {
        int j = locale.f();
        if (m != 0) {
          continue;
        }
        if (paramArrayOfBoolean2[j] == 0) {
          i += a(locale, paramArrayOfBoolean1, paramArrayOfBoolean2);
        }
      }
      locald = locald.j();
    } while (k == 0);
    label116:
    return i;
  }
  
  private void a(q paramq, a.c.x paramx, e parame)
  {
    int i2 = f.o;
    int i1 = f.n;
    int[] arrayOfInt = new int[paramq.k()];
    bb localbb = new bb();
    boolean[] arrayOfBoolean = new boolean[paramq.j()];
    int i = 0;
    Object localObject1 = paramq.v();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      e locale1 = ((w)localObject1).d();
      int k = locale1.f();
      if (i1 != 0) {
        break label119;
      }
      if ((arrayOfInt[k] = locale1.d()) == 0) {
        localbb.add(locale1);
      }
      ((w)localObject1).f();
    } while (i1 == 0);
    label119:
    do
    {
      do
      {
        if ((i2 != 0) || (localbb.isEmpty())) {
          break;
        }
        break label279;
        localObject1 = null;
        int j = 2147483647;
        Object localObject2 = localbb.f();
        do
        {
          if (localObject2 == null) {
            break label221;
          }
          e locale2 = (e)((v)localObject2).c();
          int n = a(paramq, locale2, arrayOfBoolean);
          if (i1 != 0) {
            break;
          }
          if (a(paramq, locale2, arrayOfBoolean, parame)) {
            n -= paramq.j();
          }
          if (i2 == 0)
          {
            if (n < j)
            {
              j = n;
              localObject1 = localObject2;
            }
            localObject2 = ((v)localObject2).a();
          }
        } while (i1 == 0);
        localObject2 = (e)((v)localObject1).c();
        localbb.h((v)localObject1);
        int m = ((e)localObject2).f();
        if (i2 != 0) {
          break;
        }
        d locald = ((e)localObject2).h();
        do
        {
          if (locald == null) {
            break label310;
          }
          if (i1 != 0) {
            break;
          }
          if (arrayOfInt[locald.f().f()] -= 1 == 0) {
            localbb.add(locald.f());
          }
          locald = locald.i();
        } while (i1 == 0);
        arrayOfBoolean[localObject2.f()] = true;
        paramx.a(localObject2, i++);
      } while (i2 != 0);
    } while (i1 == 0);
    label221:
  }
  
  private boolean a(q paramq, e parame1, boolean[] paramArrayOfBoolean, e parame2)
  {
    int j = f.o;
    int i = f.n;
    a.c.m localm = paramq.w();
    do
    {
      do
      {
        if (!localm.e()) {
          break;
        }
        d locald = localm.a();
        if (j == 0)
        {
          if (locald.e() != parame2)
          {
            if (j != 0) {
              continue;
            }
            if (paramArrayOfBoolean[locald.e().f()] != 0)
            {
              if (j != 0) {
                continue;
              }
              if (paramArrayOfBoolean[locald.f().f()] == 0)
              {
                e locale = locald.f();
                boolean[] arrayOfBoolean = new boolean[paramq.j()];
                a(locale, paramArrayOfBoolean, arrayOfBoolean);
                if (j != 0) {
                  continue;
                }
                if (arrayOfBoolean[parame1.f()] != 0) {
                  return true;
                }
              }
            }
          }
          localm.f();
        }
      } while (i == 0);
    } while (j != 0);
    return false;
  }
  
  private void a(q paramq, a.c.x paramx, int paramInt, e parame)
  {
    int i7 = f.o;
    int i6 = f.n;
    Comparator local1 = new Comparator()
    {
      private final a.c.x val$layerMap;
      
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        return l.a(this.val$layerMap.getInt(paramAnonymousObject2), this.val$layerMap.getInt(paramAnonymousObject1));
      }
    };
    bb localbb = new bb(paramq.t());
    localbb.a(local1);
    k localk1 = paramq.c(ed.c);
    k localk2 = paramq.c(ed.d);
    label151:
    label536:
    label540:
    label607:
    do
    {
      for (;;)
      {
        if (!localbb.isEmpty())
        {
          e locale1;
          int i;
          int[] arrayOfInt;
          int j;
          int m;
          do
          {
            locale1 = localbb.o();
            i = paramx.getInt(locale1);
            arrayOfInt = new int[paramInt];
            Object localObject1;
            int i2;
            do
            {
              do
              {
                localObject1 = paramq.v();
                do
                {
                  if (!((w)localObject1).e()) {
                    break label151;
                  }
                  localObject2 = ((w)localObject1).d();
                  arrayOfInt[paramx.getInt(localObject2)] += 1;
                  ((w)localObject1).f();
                  if ((i7 == 0) && (i6 != 0)) {
                    break;
                  }
                } while (i6 == 0);
              } while (i7 != 0);
              localObject1 = paramq.w();
              do
              {
                do
                {
                  if (!((a.c.m)localObject1).e()) {
                    break label401;
                  }
                  localObject2 = ((a.c.m)localObject1).a();
                  if (i6 != 0) {
                    break;
                  }
                  if ((((d)localObject2).e() != parame) && (((i7 == 0) && (localk1 == null)) || ((i7 == 0) && (localk2 == null)) || (((i7 != 0) || (localk1.get(localObject2) != localk2.get(localObject2))) && (((i7 == 0) && (localk1.get(localObject2) == null)) || ((i7 != 0) || (!localk1.get(localObject2).equals(localk2.get(localObject2))))))))
                  {
                    int k = Math.min(paramx.getInt(((d)localObject2).e()), paramx.getInt(((d)localObject2).f())) + 1;
                    int n = Math.max(paramx.getInt(((d)localObject2).e()), paramx.getInt(((d)localObject2).f())) - 1;
                    i2 = k;
                    do
                    {
                      if (i2 > n) {
                        break;
                      }
                      arrayOfInt[i2] += 1;
                      i2++;
                      if (i7 != 0) {
                        break label398;
                      }
                      if (i6 != 0) {
                        break label396;
                      }
                    } while (i6 == 0);
                  }
                } while (i7 != 0);
                ((a.c.m)localObject1).f();
              } while (i6 == 0);
              localObject1 = new HashMap();
              a(paramq, paramx, (Map)localObject1);
            } while (i7 != 0);
            Object localObject2 = ((Map)localObject1).entrySet().iterator();
            do
            {
              int i4;
              int i5;
              while (i5 > i4)
              {
                if (!((Iterator)localObject2).hasNext()) {
                  break;
                }
                Map.Entry localEntry = (Map.Entry)((Iterator)localObject2).next();
                localObject3 = (int[])localEntry.getValue();
                i2 = localObject3[0];
                i4 = localObject3[1];
                i5 = i2;
              }
              arrayOfInt[i5] += 1;
              i5++;
              if ((i7 != 0) || (i7 != 0)) {
                break label540;
              }
              if (i6 != 0) {
                break label536;
              }
              if ((i7 == 0) && (i6 != 0)) {
                break;
              }
            } while (i6 == 0);
            j = b();
            m = 2147483647;
          } while (i7 != 0);
          Object localObject3 = locale1.h();
          do
          {
            if (localObject3 == null) {
              break label607;
            }
            e locale2 = ((d)localObject3).f();
            m = Math.min(paramx.getInt(locale2), m);
            localObject3 = ((d)localObject3).i();
            if ((i7 == 0) && (i6 != 0)) {
              break;
            }
          } while (i6 == 0);
          if (i7 == 0) {
            if (m < 2147483647)
            {
              int i1 = i + 1;
              int i3;
              do
              {
                if (i1 >= m) {
                  break;
                }
                i3 = arrayOfInt[i1];
              } while (i6 != 0);
              if (i3 >= j)
              {
                if ((i7 == 0) && (i3 < j)) {
                  continue;
                }
                if (i7 == 0) {
                  if (b(locale1, paramx, parame)) {
                    continue;
                  }
                }
              }
              else
              {
                paramx.a(locale1, i1);
                i1++;
              }
              if (i6 == 0) {
                break;
              }
            }
          }
        }
      }
    } while (i7 != 0);
    label396:
    label398:
    label401:
    return;
  }
  
  private int a(q paramq, k paramk, i parami)
  {
    int i2 = f.o;
    int i1 = f.n;
    if (i2 == 0) {
      if (paramq.n()) {
        return 0;
      }
    }
    e[] arrayOfe = paramq.t();
    l.a(arrayOfe, l.e(paramk));
    int i = paramk.getInt(arrayOfe[0]);
    int j = i;
    int k = i;
    int m = 0;
    do
    {
      do
      {
        if (m >= arrayOfe.length) {
          break;
        }
        int n = paramk.getInt(arrayOfe[m]);
        if (i2 != 0) {
          break label154;
        }
        if (i1 != 0) {
          break label153;
        }
        if (n - j > 1) {
          k += n - j - 1;
        }
        parami.a(arrayOfe[m], n - k);
        j = n;
        m++;
      } while (i1 == 0);
    } while (i2 != 0);
    label153:
    label154:
    return j - k + 1;
  }
  
  public int a(o paramo, a.c.x paramx, ab paramab)
  {
    if (f.o == 0) {
      if (this.a) {
        return b(paramo, paramx, paramab);
      }
    }
    return c(paramo, paramx, paramab);
  }
  
  private int c(o paramo, a.c.x paramx, ab paramab)
  {
    int m = f.o;
    int k = f.n;
    int i = a(paramo, paramx, paramab, false);
    int j = a(paramo, paramx, paramab, true);
    if (i > j) {
      i = j;
    }
    while (m != 0)
    {
      if (m == 0)
      {
        if (k != 0) {
          break label73;
        }
        j = a(paramo, paramx, paramab, true);
      }
      if (k == 0) {
        break;
      }
    }
    label73:
    return j;
  }
  
  public int a(o paramo, a.c.x paramx, ab paramab, boolean paramBoolean)
  {
    int i8 = f.o;
    int i7 = f.n;
    int i = 0;
    a.i.y localy = new a.i.y(paramo);
    a.f.d.a.hb localhb = (a.f.d.a.hb)paramo.c("groupingSupport").get(paramo);
    Object localObject1 = paramo.v();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      locale1 = ((w)localObject1).d();
      if (i8 == 0)
      {
        if (localhb.g(locale1)) {
          localy.a(locale1);
        }
        ((w)localObject1).f();
      }
    } while (i7 == 0);
    localObject1 = db.b();
    e locale1 = paramo.i();
    Object localObject2 = paramo.v();
    do
    {
      if (!((w)localObject2).e()) {
        break;
      }
      localObject3 = ((w)localObject2).d();
      if (i8 != 0) {
        break label218;
      }
      if (i7 != 0) {
        break label214;
      }
      if ((i8 != 0) || (localObject3 != locale1))
      {
        if (i8 != 0) {
          continue;
        }
        if (((e)localObject3).d() == 0)
        {
          localObject4 = paramo.a(locale1, (e)localObject3);
          ((a.c.n)localObject1).a(localObject4, true);
        }
      }
      ((w)localObject2).f();
    } while (i7 == 0);
    if (i8 == 0) {
      a(paramo, localy);
    }
    label214:
    label218:
    localObject2 = db.a(new int[paramo.j()]);
    a(paramo, (a.c.x)localObject2);
    paramo.a(null, l.b((k)localObject2));
    localy.i();
    if (i8 == 0)
    {
      if (!paramBoolean)
      {
        localObject3 = a.a.x.b(paramo);
        ((bb)localObject3).j();
        localObject4 = ((bb)localObject3).l();
        do
        {
          if (!((w)localObject4).e()) {
            break;
          }
          localObject5 = ((w)localObject4).d();
          if (i8 == 0)
          {
            if (i7 != 0) {
              break label443;
            }
            paramx.a(localObject5, i++);
            ((w)localObject4).f();
          }
        } while (i7 == 0);
      }
      paramx.a(locale1, -1);
    }
    i = 0;
    Object localObject3 = paramo.v();
    if (((w)localObject3).e())
    {
      paramx.a(((w)localObject3).d(), paramx.getInt(((w)localObject3).d()) + 1);
      i = Math.max(i, paramx.getInt(((w)localObject3).d()));
      ((w)localObject3).f();
    }
    for (;;)
    {
      if (i8 == 0) {
        if (i7 == 0)
        {
          if (i7 == 0) {
            break;
          }
          if (i8 != 0) {
            continue;
          }
          i++;
        }
      }
    }
    label443:
    localObject3 = db.a(new int[paramo.j()]);
    Object localObject4 = paramo.v();
    do
    {
      if (!((w)localObject4).e()) {
        break;
      }
      localObject5 = ((w)localObject4).d();
      a((a.c.x)localObject3, (e)localObject5, paramx);
      ((w)localObject4).f();
    } while (i7 == 0);
    localObject4 = new Comparator()
    {
      private final a.c.x val$layerMap;
      private final a.c.x val$subTreeSizeMap;
      
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        int i = l.a(this.val$layerMap.getInt(paramAnonymousObject1), this.val$layerMap.getInt(paramAnonymousObject2));
        if (f.o == 0) {
          if (i == 0) {
            i = l.a(this.val$subTreeSizeMap.getInt(paramAnonymousObject1), this.val$subTreeSizeMap.getInt(paramAnonymousObject2));
          }
        }
        return i;
      }
    };
    Object localObject5 = new bb(paramo.t());
    ((bb)localObject5).a((Comparator)localObject4);
    k localk1 = paramo.c(ed.c);
    k localk2 = paramo.c(ed.d);
    label635:
    label1020:
    do
    {
      for (;;)
      {
        if (!((bb)localObject5).isEmpty())
        {
          localObject6 = ((bb)localObject5).o();
          int j = paramx.getInt(localObject6);
          int[] arrayOfInt = new int[i];
          Object localObject7 = paramo.v();
          do
          {
            if (!((w)localObject7).e()) {
              break label635;
            }
            localObject8 = ((w)localObject7).d();
            arrayOfInt[paramx.getInt(localObject8)] += 1;
            ((w)localObject7).f();
            if ((i8 == 0) && (i7 != 0)) {
              break;
            }
          } while (i7 == 0);
          if (i8 != 0) {
            break label1284;
          }
          localObject7 = paramo.w();
          int i3;
          do
          {
            do
            {
              if (!((a.c.m)localObject7).e()) {
                break label885;
              }
              localObject8 = ((a.c.m)localObject7).a();
              if (i7 != 0) {
                break label1199;
              }
              if ((((d)localObject8).e() != locale1) && (((i8 == 0) && (localk1 == null)) || ((i8 == 0) && (localk2 == null)) || (((i8 != 0) || (localk1.get(localObject8) != localk2.get(localObject8))) && (((i8 == 0) && (localk1.get(localObject8) == null)) || ((i8 != 0) || (!localk1.get(localObject8).equals(localk2.get(localObject8))))))))
              {
                int m = Math.min(paramx.getInt(((d)localObject8).e()), paramx.getInt(((d)localObject8).f())) + 1;
                int i1 = Math.max(paramx.getInt(((d)localObject8).e()), paramx.getInt(((d)localObject8).f())) - 1;
                i3 = m;
                do
                {
                  if (i3 > i1) {
                    break;
                  }
                  arrayOfInt[i3] += 1;
                  i3++;
                  if (i8 != 0) {
                    break label882;
                  }
                  if (i7 != 0) {
                    break label880;
                  }
                } while (i7 == 0);
              }
            } while (i8 != 0);
            ((a.c.m)localObject7).f();
          } while (i7 == 0);
          localObject7 = new HashMap();
          a(paramo, paramx, (Map)localObject7);
          if (i8 != 0) {
            break label1273;
          }
          Object localObject8 = ((Map)localObject7).entrySet().iterator();
          do
          {
            int i5;
            int i6;
            while (i6 > i5)
            {
              if (!((Iterator)localObject8).hasNext()) {
                break;
              }
              Map.Entry localEntry = (Map.Entry)((Iterator)localObject8).next();
              localObject9 = (int[])localEntry.getValue();
              i3 = localObject9[0];
              i5 = localObject9[1];
              i6 = i3;
            }
            arrayOfInt[i6] += 1;
            i6++;
            if ((i8 != 0) || (i8 != 0)) {
              break label1024;
            }
            if (i7 != 0) {
              break label1020;
            }
            if ((i8 == 0) && (i7 != 0)) {
              break;
            }
          } while (i7 == 0);
          int k = b();
          int n = -1;
          if (i8 != 0) {
            break label1199;
          }
          Object localObject9 = ((e)localObject6).i();
          do
          {
            if (localObject9 == null) {
              break label1090;
            }
            e locale3 = ((d)localObject9).e();
            n = Math.max(paramx.getInt(locale3), n);
            localObject9 = ((d)localObject9).j();
            if ((i8 == 0) && (i7 != 0)) {
              break;
            }
          } while (i7 == 0);
          if (i8 == 0)
          {
            int i2 = j - 1;
            int i4;
            do
            {
              if (i2 <= n) {
                break;
              }
              i4 = arrayOfInt[i2];
              if (i8 != 0) {
                break label1197;
              }
              if ((i8 != 0) || (i7 != 0)) {
                break label1195;
              }
            } while (i7 != 0);
            if (i4 >= k)
            {
              if ((i8 == 0) && (i4 < k)) {
                continue;
              }
              if (i8 == 0) {
                if (a((e)localObject6, paramx, locale1)) {
                  continue;
                }
              }
            }
            else
            {
              paramx.a(localObject6, i2);
              i2--;
            }
            if (i7 == 0) {
              break;
            }
          }
        }
      }
    } while (i8 != 0);
    label880:
    label882:
    label885:
    i = 0;
    label1024:
    label1090:
    e locale2;
    label1195:
    label1197:
    if (locale1 != null)
    {
      label1199:
      paramo.a(locale1);
      localObject6 = paramo.v();
      do
      {
        if (!((w)localObject6).e()) {
          break;
        }
        locale2 = ((w)localObject6).d();
        paramx.a(locale2, paramx.getInt(locale2) - 1);
        if (i8 != 0) {
          break label1287;
        }
        ((w)localObject6).f();
        if (i7 != 0) {
          break label1283;
        }
      } while (i7 == 0);
    }
    label1273:
    if (i8 == 0) {
      localy.g();
    }
    label1283:
    label1284:
    label1287:
    Object localObject6 = paramo.v();
    do
    {
      do
      {
        if (!((w)localObject6).e()) {
          break;
        }
        locale2 = ((w)localObject6).d();
        if (i8 == 0)
        {
          if (i7 != 0) {
            break label1354;
          }
          i = Math.max(i, paramx.getInt(locale2));
          ((w)localObject6).f();
        }
      } while (i7 == 0);
    } while (i8 != 0);
    label1354:
    return i + 1;
  }
  
  private boolean a(q paramq, k paramk, int paramInt1, int paramInt2)
  {
    int k = f.o;
    int j = f.n;
    int i = 0;
    w localw = paramq.v();
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        if (j != 0) {
          break label75;
        }
        if (paramk.getInt(localw.d()) == paramInt1) {
          i++;
        }
        localw.f();
      } while (j == 0);
    } while (k != 0);
    label75:
    return i >= paramInt2;
  }
  
  public void a(o paramo, ac paramac, bc parambc)
  {
    new hc(this).a(paramo, paramac, parambc);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.hb

 * JD-Core Version:    0.7.0.1

 */